A number of systems are designed to obtain services from network resources such as sensors, cameras, printers, and web services. These resources may be mobile, they may be ephemeral, and their quality of service may fluctuate. It has become widely accepted that such systems should not require users to name a specific resource from which they wish to obtain services, but rather, to describe what the resource is expected to provide, so that the system can discover an appropriate resource. This approach, known as descriptive naming, allows the system to select the best available resource, based on current conditions, and it makes an application robust against the failure of any one device. The approach accommodates the frequent addition of resources to, or removal of resources from, the system, without modification of the application that uses such resources. The approach also allows an application written for one environment to be ported easily to another environment with a different set of resources.
A number of approaches have been taken to describe what a resource is expected to provide. Many of the approaches feature queries based on a flat structure of categories, with each resource residing in precisely one category. More powerful approaches support a hierarchy of categories, in which all resources in a category C can be used in any context in which a resource in a category above C in the hierarchy can be used. A query for resources in a category above C can be satisfied not only by resources of that category, but also by resources of category C.
Many approaches allow queries to test attributes of resources, but restrict the kinds of tests that can be performed, or the ways in which tests of different attributes can be combined. An approach that only allows a conjunction of attribute-equality tests is inadequate for determining whether a resource with attributes giving the x and y coordinates of a point corresponds to a point inside a given rectangle. If ordering comparisons as well as equality tests are allowed, it is possible to query for placement within a given rectangle, but not for placement inside any of a set of rectangles.
Ontology-based query systems support unstructured queries, in particular natural-language queries, and apply common-sense reasoning to deduce facts that are not explicitly represented in the data sources being queried. Such systems may return an answer to some question different from the question that was posed to it, if the system deduces that the answer reflects the questioner's intent. Development of ontologies is labor-intensive, so few exist yet, and it is not clear that resources will exist in the long run to maintain them. Furthermore, for applications that expect precise answers to precisely posed questions, returning an approximate answer, or an answer to a closely related question, is unacceptable.